<template>
  <div />
</template>

<script>
export default {
  name: 'MultiTab',
  data() {
    return {
      tabs: []
    }
  },
  methods: {
    findIndex(tab) {
      let index = -1
      this.tabs.forEach((item, i) => {
        if (item.name === tab.name) {
          index = i
        }
      })
      return index
    },
    addTab(tab) {
      const index = this.findIndex(tab)
      if (index === -1) {
        this.tabs.push(tab)
      }
    },
    delTab(i) {
      this.tabs.splice(i, 1)
    }
  }
}
</script>

<style scoped>

</style>
